---
title: Submit an Appworx batch job (shared overload)
summary: One-call façade that selects a data portal, builds a submission instance, and submits a batch job to Appworx.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Services.Appworx
reference_type: embedded
operation_id: OP-01
trigger: An application/business manager needs a scheduler job run
---

# Submit an Appworx batch job (shared overload)

This is the form actually used by all in-repo callers: a single static call that decides which data portal to use, constructs a fresh `clsRequestAppworxJob` instance, maps only the arguments the caller supplied, and submits the job.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-01 |
| **Trigger** | Application manager needs a scheduler job run (in this repo: printing LegalNet letters after a create-file, a mailed-date update, or a new reconsideration request) |
| **Inputs** | `inDPI` (data-portal context), `inModule` (required), `inRequestor` (default `"Appworx"`), `inPrinter` (default `"SYSOUT"`), `inArg1`..`inArg20` (all optional, default `Nothing`), `inUseWCISDEV1AppworxForAllDevEnv` (default `False`) |
| **Outputs** | None (`Sub`). Side effect: a job request row is created in the Appworx scheduler by the stored procedure. |
| **Primary components** | `clsRequestAppworxJob.SubmitBatchJob` (Shared) |
| **Entry point** | `SAIF.Services.Appworx/clsRequestAppworxJob.vb` |

## Steps

1. Decide which data portal to use ([BR-001](../business-rules.md#br-001-environment-based-portal-routing-to-pradt), [BR-002](../business-rules.md#br-002-production-only-routing-to-the-production-appworx-database)).
   - If `inUseWCISDEV1AppworxForAllDevEnv` is `True`: query `AppGlobal.EnvironmentService.GetApplicationEnvironment()`; when the result is `ApplicationEnvironment.Prod`, build `New clsMSOracleDataLayer("PRADT", "WCISPROD")`, otherwise build `New clsMSOracleDataLayer("PRADT", "WCISDEV1")`, then take `lDAL.DataPortalInfo()` as the portal.
   - If the flag is `False`: use the caller-supplied `inDPI` unchanged.
2. Construct `New clsRequestAppworxJob(lDPI)`; the constructor calls `InitArgs()` ([BR-007](../business-rules.md#br-007-argument-slots-never-carry-over-between-submissions)).
3. Call `RequestJob.InitArgs()` again explicitly — redundant, the constructor already did it*.
4. Assign `ModuleName`, `Requestor`, `Printer` from the parameters unconditionally, so the optional defaults always win over the field defaults ([BR-004](../business-rules.md#br-004-module%2C-requestor%2C-and-printer-are-always-supplied-with-defaults)).
5. For each of `inArg1`..`inArg20`, assign the corresponding `ArgN` property only when the parameter `IsNot Nothing` ([BR-003](../business-rules.md#br-003-only-populated-argument-slots-are-transmitted)).
   - An explicitly passed empty string is assigned here, but is still suppressed later by the `clsSmartString` empty test in [Execute the Appworx submission stored procedure](submit-batch-job-instance.md)*.
6. Call the instance `SubmitBatchJob()`.
   - > **Origin**: Step 6 delegates to [Execute the Appworx submission stored procedure](submit-batch-job-instance.md), implemented in the same class (`clsRequestAppworxJob`).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Application manager needs a<br>job run"]) --> D{inUseWCISDEV1AppworxForAllDevEnv?}
	D -->|Yes| Env{Environment = Prod?}
	Env -->|Yes| PortalProd[Portal = PRADT@WCISPROD]
	Env -->|No| PortalDev[Portal = PRADT@WCISDEV1]
	D -->|No| PortalCaller[Portal = caller's inDPI]
	PortalProd --> Construct[Construct clsRequestAppworxJob<br>InitArgs]
	PortalDev --> Construct
	PortalCaller --> Construct
	Construct --> Assign[Assign ModuleName, Requestor, Printer,<br>non-Nothing ArgN]
	Assign --> Submit[Call instance SubmitBatchJob]
	Submit --> EndOk(["Returns, or exception<br>propagates"])
```

## Failure and edge-case behavior
- No error handling of its own; any exception from the instance `SubmitBatchJob` (already wrapped as `ApplicationException` per [BR-006](../business-rules.md#br-006-submission-failures-are-wrapped-and-rethrown)) propagates to the caller.

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Services.Appworx/clsRequestAppworxJob.vb`
